<template>
  <div>
    <!-- 开卡 -->
    <VolBox
      :lazy="true"
      :model.sync="model"
      title="开卡"
      :width="Mwidth"
      :height="Mheight"
    >
      <VolForm
        ref="myform"
        :label-width="100"
        :loadKey="true"
        :formFields="formFields"
        :formRules="formRules"
      ></VolForm>
      <VolForm
        v-show="HYZHSTATUS"
        ref="myform4"
        :loadKey="true"
        :formFields="formFields5"
        :formRules="formRules5"
      ></VolForm>
      <div v-show="KKSTATUS">
        <el-button class="tjBut" type="primary" @click="MebCardGet" size="small"
          >添加卡</el-button
        >
        <VolTable
          ref="editTable1"
          :columns="columnsKK"
          :max-height="370"
          :index="true"
          :ck="false"
          :tableData="saveCheckList"
        ></VolTable>
      </div>
      <div slot="footer">
        <Button type="success" @click="submit1">保存</Button>
        <Button type="default" @click="model = false">关闭</Button>
      </div>
    </VolBox>

    <!-- ----start------ -->
    <VolBox
      :model.sync="modelkcl"
      :padding="30"
      title="卡处理"
      :width="950"
      :height="550"
    >
      <VolHeader icon="md-apps" text="卡处理" style="margin-bottom: 20px">
        <div style="text-align: right; padding-bottom: 4px">
          <Button
            type="error"
            icon="logo-freebsd-devil"
            @click="cancellation"
            :disabled="CARDDATA.cardstatus == 5"
            >作废</Button
          >
          <Button type="error" icon="logo-freebsd-devil" @click="cancfreeze">{{
            djName
          }}</Button>
          <Button
            type="error"
            icon="logo-freebsd-devil"
            @click="extension"
            :disabled="CARDDATA.memberid == '' || CARDDATA.cardstatus == 5"
            >延期</Button
          >
          <Button
            type="error"
            icon="logo-freebsd-devil"
            @click="WriteCard"
            :disabled="CARDDATA.cardstatus == 5"
            >写卡</Button
          >
          <Button
            type="error"
            icon="logo-freebsd-devil"
            @click="ReplacementCard"
            :disabled="CARDDATA.cardstatus == 5"
            >补卡</Button
          >
          <Button
            type="error"
            icon="logo-freebsd-devil"
            @click="steganogram"
            :disabled="CARDDATA.cardstatus == 5"
            >{{ CARDDATA.password == null ? "密码" : "改密码" }}</Button
          >
          <Button
            type="info"
            icon="logo-freebsd-devil"
            @click="Rechdarge(1)"
            :disabled="CARDDATA.is_basetype == 2 || carStatsCZ"
            >充值</Button
          >
          <Button
            type="info"
            icon="logo-freebsd-devil"
            @click="Rechdarge(2)"
            :disabled="CARDDATA.cardstatus != 3"
            >消费</Button
          >
          <Button
            type="info"
            icon="ios-create"
            :disabled="tableDataKcl.length == 0 || CARDDATA.cardstatus == 5"
            @click="Rechdarge(3)"
            >调整</Button
          >
          <Button
            type="info"
            icon="ios-albums"
            :disabled="tableDataKcl.length == 0 || CARDDATA.cardstatus == 5"
            @click="Rechdarge(4)"
            >冲账</Button
          >
        </div>
      </VolHeader>
      <VolForm
        ref="myKclform"
        :formFileds="formKclFileds"
        :formRules="formKclRules"
      >
      </VolForm>
      <div style="padding: 0px 20px">
        <VolTable
          ref="ashjkdtable"
          :columns="columnsKcl"
          :tableData="tableDataKcl"
          :max-height="300"
          :index="true"
        ></VolTable>
      </div>
      <div slot="footer">
        <Button type="success" @click="modelkclSub">保存</Button>
        <Button type="info" @click="modelkcl = false">关闭</Button>
      </div>
    </VolBox>
    <VolBox
      :model.sync="modelCFZ"
      :title="modeltitle"
      :width="400"
      :height="250"
    >
      <VolForm
        ref="myCFZform"
        :formFileds="formCFZFileds"
        :formRules="formCFZRules"
        :labelWidth="100"
      ></VolForm>
      <div slot="footer">
        <Button type="success" @click="getFirstRow">保存</Button>
        <Button type="info" @click="modelCFZ = false">关闭</Button>
      </div>
    </VolBox>
    <!-- ------END------------ -->
    <VolBox
      :lazy="true"
      :model.sync="model2"
      title="选择卡片"
      :width="1000"
      :height="500"
    >
      <VolForm
        ref="myformkp"
        :label-width="100"
        :loadKey="true"
        :formFields="formFieldskp"
        :formRules="formRuleskp"
      ></VolForm>
      <div class="xxx-box">
        <!-- 表格 -->
        <div class="all-check">
          <el-checkbox v-model="pageChecked" @change="checkAll"
            >跨页全选</el-checkbox
          ><span class="all-check-span"
            >已选择{{ saveCheckList.length }}条数据</span
          >
        </div>
        <el-table
          :data="tableData2"
          ref="mListTable"
          @select="changeSelect"
          @select-all="selectAll"
        >
          <el-table-column type="selection" width="55"> </el-table-column>
          <el-table-column prop="cardno" label="卡号" width="180">
          </el-table-column>
          <el-table-column prop="cardstatus" label="卡状态" width="100">
            <template slot-scope="scope">
              <span>{{ getText(MebCardStatus, scope.row.cardstatus) }}</span>
            </template>
          </el-table-column>
          <el-table-column prop="cardtype" label="卡模板" width="100">
            <template slot-scope="scope">
              <span>{{ getText(MebCardType, scope.row.cardtype) }}</span>
            </template>
          </el-table-column>
          <el-table-column prop="balance" label="余额" width="100">
          </el-table-column>
          <el-table-column prop="denomination" label="面值" width="100">
          </el-table-column>
          <el-table-column prop="description" label="描述"> </el-table-column>
        </el-table>
        <!-- 分页 -->
        <div class="all-el-page">
          <el-pagination
            @size-change="handleSizeChange"
            @current-change="handleCurrentChange"
            :current-page="queryParams.page"
            :page-size="queryParams.size"
            layout="total, prev, pager, next, jumper"
            :total="fyTotal"
          >
          </el-pagination>
        </div>
      </div>
      <div slot="footer">
        <Button type="default" @click="submit2">保存</Button>
        <Button type="default" @click="model2 = false">关闭</Button>
      </div>
    </VolBox>

    <!-- 发卡 -->
    <VolBox
      :lazy="true"
      :model.sync="model4"
      title="发卡"
      :width="800"
      :height="400"
    >
      <el-button size="small" @click="MebCardGet" type="primary"
        >选择卡片</el-button
      >
      <VolForm
        ref="myform4"
        :label-width="100"
        :loadKey="true"
        :formFields="formFields4"
        :formRules="formRules4"
      ></VolForm>
      <div slot="footer">
        <Button type="success" @click="submit4" :loading="loading">保存</Button>
        <Button type="default" @click="model4 = false">关闭</Button>
      </div>
    </VolBox>
    <!-- 延期 -->
    <VolBox :lazy="true" :model.sync="model6" title="延期">
      <VolForm
        ref="myform6"
        :label-width="100"
        :loadKey="true"
        :formFields="formFields6"
        :formRules="formRules6"
      ></VolForm>
      <div slot="footer">
        <Button type="success" @click="submit6">保存</Button>
        <Button type="default" @click="model6 = false">关闭</Button>
      </div>
    </VolBox>
    <VolBox
      :lazy="true"
      :model.sync="model7"
      title="改密码"
      :width="500"
      :height="300"
    >
      <VolForm
        ref="myform7"
        :label-width="100"
        :loadKey="true"
        :formFields="formFields7"
        :formRules="formRules7"
      ></VolForm>
      <div slot="footer">
        <Button type="success" @click="submit7">保存</Button>
        <Button type="default" @click="model7 = false">关闭</Button>
      </div>
    </VolBox>

    <!-- 卡历史查看 -->
    <VolBox
      :lazy="true"
      :model.sync="modelLook"
      title="历史记录"
      :width="1200"
      :height="500"
    >
      <VolTable
        ref="editTableLook"
        :columns="columnsLook"
        :max-height="500"
        :index="true"
        :tableData="tableDataLook"
        :ck="false"
      ></VolTable>
      <div slot="footer">
        <Button type="default" @click="modelLook = false">关闭</Button>
      </div>
    </VolBox>
    <!-- 写卡记录 -->
    <VolBox
      :lazy="true"
      :model.sync="modelXK"
      title="写卡记录"
      :width="800"
      :height="400"
    >
      <VolTable
        ref="editTableLook"
        :columns="columnsXK"
        :max-height="400"
        :index="true"
        :tableData="tableDataXK"
        :ck="false"
      ></VolTable>
      <div slot="footer">
        <Button type="default" @click="modelXK = false">关闭</Button>
      </div>
    </VolBox>
  </div>
</template>

<script>
import VolBox from "@/components/basic/VolBox.vue";
import VolForm from "@/components/basic/VolForm.vue";
import VolTable from "@/components/basic/VolTable.vue";
import VolHeader from "@/components/basic/VolHeader.vue";
import { formatDate } from "@/utils/globalMethods.js";
var vueParam = {
  components: {
    VolBox,
    VolForm,
    VolHeader,
    VolTable
  },
  data() {
    return {
      modelkcl: false,
      formKclFileds: {
        cardno: "",
        memberid: "",
        cardstatus: "",
        cardtype: "",
        validendatedate: "",
        cardstatus: "",
        memberName: "",
        balance: "",
        description: "",
        is_freeze: ""
      },
      formKclRules: [
        [
          {
            title: "卡号",
            field: "cardno",
            type: "text",
            readonly: true,
            colSize: 3
          },
          {
            title: "姓名",
            field: "memberName",
            type: "text",
            readonly: true,
            colSize: 3
          },
          {
            title: "手机号",
            field: "memberid",
            type: "text",
            readonly: true,
            colSize: 3
          },
          {
            title: "是否冻结",
            field: "is_freeze",
            type: "int",
            readonly: true,
            colSize: 3,
            datakey: "",
            data: [
              {
                key: 0,
                value: "不冻结"
              },
              {
                key: 1,
                value: "冻结"
              }
            ]
          }
        ],
        [
          {
            title: "卡状态",
            field: "cardstatus",
            type: "int",
            readonly: true,
            colSize: 3,
            datakey: "",
            data: []
          },
          {
            title: "余额",
            field: "balance",
            type: "text",
            readonly: true,
            colSize: 3
          },
          {
            title: "有效截止日期",
            field: "validendatedate",
            type: "text",
            readonly: true,
            colSize: 3
          }
        ],
        [
          {
            title: "备注",
            field: "description",
            type: "textarea",
            colSize: 6
          }
        ]
      ],
      consumptiFormModel: false,
      formXFFileds: {
        amount: "",
        remark: ""
      },
      currentPage: 1, // 当前页数
      total: 0, // 总条数
      //查询条件字段
      params: {
        datetime: "",
        functype: "",
        start: 0, //起始下标
        count: 30 //请求条数
      },
      viewModel: false, //点击单元格时弹出框
      columnsKcl: [
        {
          field: "createDate",
          title: "入账日期",
          type: "datetime",
          width: 150,
          align: "left"
        },
        {
          field: "type_func",
          title: "类型",
          type: "string",
          width: 100,
          align: "left",
          bind: {
            key: "audit",
            data: [
              { key: 1, value: "充值" },
              { key: 2, value: "消费" },
              { key: 3, value: "调整" },
              { key: 4, value: "冲账" },
              { key: 5, value: "退款" }
            ]
          }
        },
        {
          field: "amount",
          title: "订单金额",
          type: "int",
          width: 100,
          align: "left"
        },
        {
          field: "balance",
          title: "可用余额",
          type: "string",
          width: 100,
          align: "left"
        },
        {
          field: "orderid",
          title: "凭证号",
          type: "string",
          width: 100,
          align: "left"
        },
        {
          field: "serial_number",
          title: "流水单号",
          type: "string",
          width: 100,
          align: "left"
        },
        {
          field: "creator",
          title: "操作人",
          type: "string",
          width: 100,
          align: "left"
        },
        {
          field: "remark",
          title: "备注",
          type: "string",
          width: 100,
          align: "left"
        }
      ],
      tableDataKcl: [],
      model: false,
      formFields: {
        name: "",
        // usertype: "",
        member_phone: ""
      },
      formRules: [
        [
          {
            title: "会员手机号",
            field: "member_phone",
            type: "text",
            required: true
          },
          {
            render: (h, {}) => {
              return h(
                "button",
                {
                  class: "ivu-btn",
                  style: {
                    "margin-left": "10px"
                  },
                  on: {
                    click: () => {
                      // SSS005SSS
                      let merchantCode = JSON.parse(
                        sessionStorage.getItem("user")
                      ).merchantCode;
                      let param = {
                        order: "desc",
                        page: 1,
                        rows: 30,
                        sort: "",
                        wheres: `[{\"name\":\"member_phone\",\"value\":\"${this.formFields.member_phone}\",\"displayType\":\"text\"}]`
                      };
                      this.http
                        .post("/api/MebAccount/GetMebAccountPageData", param)
                        .then(res => {
                          if (res.rows.length != 0) {
                            this.formFields.name = res.rows[0].member_name;
                            // this.formFields.usertype =
                            //   res.rows[0].status.toString();
                            this.member_phone = res.rows[0].member_phone;
                            // console.log(res.rows, res.rows[0].id);
                            this.HYZHSTATUS = false;
                          } else {
                            this.HYZHSTATUS = true;
                            this.$refs.myform4.reset();
                            this.formFields.name = "";
                          }
                        });
                    }
                  }
                },
                "查询"
              );
            }
          }
        ],
        [
          {
            title: "会员姓名",
            field: "name",
            type: "text",
            required: true
          }
          // {
          //   title: "会员状态",
          //   field: "usertype",
          //   type: "select",
          //   dataKey: "Member_Status",
          //   data: [],
          //   disabled: true,
          // },
        ]
      ],
      columns: [
        {
          field: "cardno",
          title: "卡号",
          type: "string",
          width: 120,
          align: "left"
        },
        {
          field: "cardstatus",
          title: "卡状态",
          type: "int",
          width: 120,
          align: "left",
          bind: { key: "MebCardStatus", data: [] }
        },
        {
          field: "cardtype",
          title: "卡模板",
          type: "int",
          width: 120,
          align: "left",
          bind: { key: "MebCardType", data: [] }
        },
        {
          field: "balance",
          title: "余额",
          type: "decimal",
          width: 120,
          align: "left"
        },
        {
          field: "denomination",
          title: "面值",
          type: "decimal",
          width: 120,
          align: "left"
        },
        {
          field: "description",
          title: "描述",
          type: "string",
          width: 120,
          align: "left"
        }
      ],
      columnsKK: [
        {
          field: "cardno",
          title: "卡号",
          type: "string",
          width: 120,
          align: "left"
        },
        {
          field: "cardstatus",
          title: "卡状态",
          type: "int",
          width: 120,
          align: "left",
          bind: { key: "MebCardStatus", data: [] }
        },
        {
          field: "cardtype",
          title: "卡模板",
          type: "int",
          width: 120,
          align: "left",
          bind: { key: "MebCardType", data: [] }
        },
        {
          field: "balance",
          title: "余额",
          type: "decimal",
          width: 120,
          align: "left"
        },
        {
          field: "denomination",
          title: "面值",
          type: "decimal",
          width: 120,
          align: "left"
        },
        {
          field: "description",
          title: "描述",
          type: "string",
          width: 120,
          align: "left"
        },
        {
          field: "amount",
          title: "操作",
          type: "int",
          width: 80,
          fixed: "right",
          align: "left",
          render: (h, { row, column, index }) => {
            return h(
              "button",
              {
                class: "ivu-btn",
                style: {
                  "margin-left": "10px"
                },
                on: {
                  click: () => {
                    this.saveCheckList.splice(index, 1);
                  }
                }
              },
              "删除"
            );
          }
        }
      ],
      tableData: [],
      model2: false,
      columns2: [
        {
          field: "cardno",
          title: "卡号",
          type: "string",
          width: 120,
          align: "left"
        },
        {
          field: "memberid",
          title: "会员编号",
          type: "string",
          width: 160,
          align: "left"
        },
        {
          field: "cardstatus",
          title: "卡状态",
          type: "int",
          width: 120,
          align: "left",
          bind: { key: "MebCardStatus", data: [] }
        },
        {
          field: "cardtype",
          title: "卡模板",
          type: "int",
          width: 120,
          align: "left",
          bind: { key: "MebCardType", data: [] }
        },
        {
          field: "balance",
          title: "余额",
          type: "decimal",
          width: 120,
          align: "left"
        },
        {
          field: "denomination",
          title: "面值",
          type: "decimal",
          width: 120,
          align: "left"
        },
        {
          field: "description",
          title: "描述",
          type: "string",
          width: 120,
          align: "left"
        },
        {
          field: "creator",
          title: "创建人",
          type: "string",
          width: 120,
          align: "left"
        },
        {
          field: "createDate",
          title: "创建时间",
          type: "datetime",
          width: 120,
          align: "left",
          sortable: true
        },
        {
          field: "modifier",
          title: "修改人",
          type: "string",
          width: 120,
          align: "left"
        },
        {
          field: "modifyDate",
          title: "修改时间",
          type: "datetime",
          width: 120,
          align: "left",
          sortable: true
        },
        {
          field: "validatedate",
          title: "有效截止日期",
          type: "datetime",
          width: 120,
          align: "left",
          sortable: true
        }
      ],
      tableData2: [],
      member_phone: "",
      formFields4: {
        opersqrorId: []
      },
      formRules4: [
        [
          {
            title: "授权人",
            field: "opersqrorId",
            type: "transfer",
            titles: ["未选授权人", "选中授权人"],
            data: []
          }
        ]
      ],
      loading: false,
      model4: false,
      tableData4: [],
      model5: false,
      KKSTATUS: false,
      Mwidth: 0,
      Mheight: 0,
      CARDDATA: {},
      HYZHSTATUS: false,
      formFields5: { idcardtype: "", idnumber: "" },
      formRules5: [
        [
          {
            title: "证件类型",
            field: "idcardtype",
            type: "select",
            dataKey: "certificate_type",
            data: []
            // required: true,
          },
          {
            title: "证件号",
            field: "idnumber",
            type: "text"
            // required: true,
          }
        ]
      ],
      CZSTATUS: false,
      model6: false,
      formFields6: { validendatedate: "" },
      formRules6: [],
      model7: false,
      formFields7: {
        id: "",
        oldPassword: "",
        newPassword: "",
        repeatPassword: ""
      },
      formRules7: [
        [
          {
            title: "卡号",
            field: "id",
            type: "text",
            disabled: true
          }
        ],
        [
          {
            title: "初始密码",
            field: "oldPassword",
            type: "text",
            disabled: true,
            required: true
          }
        ],
        [
          {
            title: "新密码",
            field: "newPassword",
            type: "text",
            hidden: true,
            required: true,
            max: 6
          }
        ],
        [
          {
            title: "确认密码",
            field: "repeatPassword",
            type: "text",
            hidden: true,
            required: true,
            max: 6
          }
        ]
      ],
      // model7Detail: {}
      MebcardtypeList: [],
      rowID: "",
      modelCFZ: false,
      modeltitle: "",
      jakob: {
        memberid: "",
        cardno: "",
        amount: "",
        cardid: ""
      },
      formCFZFileds: {
        amount: "",
        remark: "",
        paytype: "",
        orderid: "",
        czid: ""
      },
      formCFZRules: [
        [
          {
            title: "金额",
            field: "amount",
            type: "decimal",
            required: true,
            hidden: false
          }
        ],
        [
          {
            title: "凭证号",
            field: "orderid",
            type: "text",
            required: true,
            hidden: false
          }
        ],
        [
          {
            title: "支付方式",
            field: "paytype",
            type: "select",
            dataKey: "",
            data: [
              {
                key: 0,
                value: "支付宝"
              },
              {
                key: 1,
                value: "微信"
              },
              {
                key: 2,
                value: "现金"
              },
              {
                key: 3,
                value: "电汇"
              },
              {
                key: 4,
                value: "挂账"
              }
            ],
            required: true,
            hidden: false
          }
        ],
        [
          {
            title: "备注",
            field: "remark",
            type: "textarea",
            placeholder: "请输入备注"
          }
        ]
      ],
      timeState: false,
      socket: null,
      carStatsCZ: false,
      timerId: null,
      // 查看卡
      modelLook: false,
      tableDataLook: [],
      columnsLook: [
        {
          field: "recordcreator",
          title: "发卡人",
          type: "string",
          width: 100,
          align: "left"
        },
        {
          field: "recordoperatorName",
          title: "接收人",
          type: "string",
          width: 140,
          align: "left"
        },
        {
          field: "recordCreateDate",
          title: "创建时间",
          type: "string",
          width: 120,
          align: "left"
        },
        {
          field: "cardname",
          title: "卡模板",
          type: "string",
          width: 120,
          align: "left"
        },
        {
          field: "cardno",
          title: "卡号",
          type: "string",
          width: 120,
          align: "left"
        },
        {
          field: "memberName",
          title: "会员名",
          type: "string",
          width: 80,
          align: "left"
        }
      ],
      formFieldskp: {
        cardtype: "",
        cardstatus: ""
      },
      formRuleskp: [
        [
          {
            title: "卡模板",
            field: "cardtype",
            type: "select",
            dataKey: "",
            data: [],
            onChange: val => {
              this.MebCardGet();
            },
            colSize: 6
          },
          {
            title: "卡状态",
            field: "cardstatus",
            type: "select",
            dataKey: "",
            data: [],
            onChange: val => {
              this.MebCardGet();
            },
            colSize: 6
          }
        ]
      ],
      vc: 1,
      modelXK: false,
      columnsXK: [
        {
          field: "order_number",
          title: "卡号",
          type: "string",
          width: 150,
          align: "left"
        },
        {
          field: "userName",
          title: "创建人",
          type: "string",
          width: 120,
          align: "left"
        },
        {
          field: "beginDate",
          title: "时间",
          type: "string",
          width: 120,
          align: "left"
        },
        {
          field: "logType",
          title: "日志类型",
          type: "string",
          width: 60,
          align: "left"
        },
        {
          field: "exceptionInfo",
          title: "操作内容",
          type: "string",
          width: 120,
          align: "left",
          show: true
        }
      ],
      tableDataXK: [],
      pageChecked: false, //全选切换状态
      // 保存起来的选择项
      saveCheckList: [],
      // 分页
      queryParams: {
        page: 1,
        size: 20
      },
      // 分页总数
      fyTotal: 0,
      MebCardType: [],
      MebCardStatus: [],
      djName: ""
    };
  },
  methods: {
    getText(l, v) {
      // console.log(l);
      let b = l.filter(i => {
        return i.key == v;
      });
      // console.log(b);
      if (b.length != 0) {
        return b[0].value;
      } else {
        return "";
      }
    },
    // 当页勾选以及取消
    changeSelect(selection, row) {
      // 从保存项saveCheckList里面寻找,如果找到了row则删除，如果没找到则添加
      let fitemIndex = this.saveCheckList.findIndex(item => {
        return item.id == row.id;
      });
      if (fitemIndex < 0) {
        this.saveCheckList.push(row);
      } else {
        this.saveCheckList.splice(fitemIndex, 1);
      }
    },
    // 表格全选内容
    selectAll(val) {
      // 如果为空，则为清除选项状态，此时将table中的所有内容都从saveCheckList移除
      if (val && val.length == 0) {
        this.tableData2.forEach(row => {
          // 从保存项saveCheckList里面寻找,如果找到了row则删除，如果没找到则添加
          let fitemIndex = this.saveCheckList.findIndex(item => {
            return item.id == row.id;
          });
          // 找到了就删除掉
          if (fitemIndex >= 0) {
            this.saveCheckList.splice(fitemIndex, 1);
          }
        });
      } else if (val && val.length != 0 && this.saveCheckList.length != 0) {
        // 如果不为空,且this.saveCheckList也不为空则从val里面找
        val.forEach(row => {
          // 从保存项saveCheckList里面寻找,如果找到了row则删除，如果没找到则添加
          let fitemIndex = this.saveCheckList.findIndex(item => {
            return item.id == row.id;
          });
          // 没找到就push进去
          if (fitemIndex < 0) {
            this.saveCheckList.push(row);
          }
        });
      } else if (val && val.length != 0 && this.saveCheckList.length == 0) {
        val.forEach(row => {
          this.saveCheckList.push(row);
        });
      }
    },
    // 全选按钮
    checkAll() {
      // 全选操作
      if (this.pageChecked) {
        let userID = JSON.parse(sessionStorage.getItem("sessionStorageUSER"));
        let param = {
          order: "desc",
          page: 1,
          rows: 1000000,
          sort: "",
          wheres: `[{\"name\":\"cardstatus\",\"value\":\"${this.formFieldskp.cardstatus}\",\"displayType\":\"text\"},{\"name\":\"operatorID\",\"value\":\"${userID.userId}\",\"displayType\":\"like\"},{\"name\":\"cardtype\",\"value\":\"${this.formFieldskp.cardtype}\",\"displayType\":\"select\"}]`
        };
        this.http.post("/api/MebCard/getPageData", param).then(res => {
          this.saveCheckList = res.rows;
          this.$nextTick(() => {
            this.$refs["mListTable"].clearSelection();
            this.$refs["mListTable"].toggleAllSelection();
          });
        });
      } else {
        // 取消全选，当前所有选择项清空
        this.saveCheckList = [];
        // 将当前的页的所有内容取消勾选状态
        this.$nextTick(() => {
          this.$refs["mListTable"].clearSelection();
        });
      }
    },
    // 分页切换时准备表格的选中状态 -- 这个内容必须放在表格数据赋值之后--()
    // tableList 为当前表格的数据
    checkPageStatus(tableList) {
      tableList.forEach(row => {
        let findex = this.saveCheckList.findIndex(item => {
          return item.id == row.id;
        });
        if (findex >= 0) {
          this.$nextTick(() => {
            this.$refs["mListTable"].toggleRowSelection(row);
          });
        }
      });
    },
    /* 分页 */
    handleSizeChange(val) {
      this.queryParams.size = val;
      this.getList();
    },
    /* 分页 */
    handleCurrentChange(val) {
      this.queryParams.page = val;
      this.getList();
    },
    cardXK(e) {
      let params = {
        order: "asc",
        page: 1,
        rows: 100,
        sort: "beginDate",
        wheres: `[{\"name\":\"order_number\",\"value\":\"${e.id}\",\"displayType\":\"like\"}]`
      };
      this.http.post("api/Small_log/GetSmallLogDetail", params).then(res => {
        if (res.status == 0) {
          this.tableDataXK = res.rows;
          this.tableDataXK.forEach(i => {
            i.order_number = e.cardno;
          });
        }
      });
    },

    getKCL(e) {
      this.modelkcl = true;
      this.CARDDATA = e;
      this.formKclFileds.cardno = e.cardno;
      this.formKclFileds.memberid = e.memberid;
      this.formKclFileds.memberName = e.memberName;
      this.formKclFileds.cardstatus = e.cardstatus.toString();
      this.formKclFileds.cardtype = e.cardtype;
      this.formKclFileds.validendatedate = e.validendatedate;
      this.formKclFileds.balance = e.balance;
      this.formKclFileds.description = e.description;
      this.formKclFileds.is_freeze = e.is_freeze;
      this.jakob.cardid = e.id;
      this.formFields7.id = e.id;
      this.getPagData(e.id);
      this.GetVueDictionary();
      let now = new Date();
      let end = new Date(e.validendatedate);
      if (now > end) {
        this.timeState = true;
      } else {
        this.timeState = false;
      }

      if (e.cardstatus == 1 || e.cardstatus == 2 || e.cardstatus == 3) {
        this.carStatsCZ = false;
      } else {
        this.carStatsCZ = true;
      }
      if (e.is_freeze == 0 || e.is_freeze == null) {
        this.djName = "冻结";
      } else {
        this.djName = "解冻";
      }
    },

    // 查询按钮
    searchClick() {
      this.params.start = 0;
      this.params.count = 9999;
      this.getPagData(this.jakob.cardid);
    },
    // 重置按钮
    resetSearch() {
      this.params.datetime = "";
      this.params.functype = "";
      this.getPagData(this.jakob.cardid);
    },
    //
    getFormKclOption(field) {
      let option;
      this.formKclRules.forEach(x => {
        x.forEach(item => {
          if (item.field == field) {
            option = item;
          }
        });
      });
      return option;
    },
    getFormCFZOption(field) {
      let option;
      this.formCFZRules.forEach(x => {
        x.forEach(item => {
          if (item.field == field) {
            option = item;
          }
        });
      });
      return option;
    },
    getForm7(field) {
      let option;
      this.formRules7.forEach(x => {
        x.forEach(item => {
          if (item.field == field) {
            option = item;
          }
        });
      });
      return option;
    },
    Rechdarge(e) {
      let paytype = this.getFormCFZOption("paytype");
      let orderid = this.getFormCFZOption("orderid");
      let amount = this.getFormCFZOption("amount");
      let arr = this.$refs.ashjkdtable.$refs.table.selection;
      this.$refs.myCFZform.reset();
      switch (e) {
        case 1:
          this.modeltitle = "充值";
          paytype.hidden = false;
          paytype.required = true;
          orderid.required = true;
          orderid.hidden = false;
          amount.hidden = false;
          amount.required = true;
          break;
        case 2:
          this.modeltitle = "消费";
          paytype.hidden = true;
          paytype.required = false;
          orderid.hidden = false;
          orderid.required = true;
          amount.hidden = false;
          amount.required = true;
          break;
        case 3:
          this.modeltitle = "调整";
          paytype.hidden = true;
          paytype.required = false;
          orderid.hidden = true;
          orderid.required = false;
          this.formCFZRules[0][0] = {
            title: "金额",
            field: "amount",
            type: "minusDecimal",
            required: true
          };
          break;
        case 4:
          this.modeltitle = "冲账";
          paytype.hidden = true;
          paytype.required = false;
          orderid.hidden = true;
          orderid.required = false;
          amount.hidden = true;
          amount.required = false;
          this.formCFZFileds.amount = 1;
          break;
      }
      if (e == 3 || e == 4) {
        if (arr.length == 1) {
          this.modelCFZ = true;
          this.formCFZFileds.czid = arr[0].id;
        } else {
          this.$message.error("请选择一条数据");
        }
      } else {
        this.formCFZRules[0][0] = {
          title: "金额",
          field: "amount",
          type: "decimal",
          required: true
        };
        this.modelCFZ = true;
      }

      this.jakob = {
        memberid: this.CARDDATA.memberid,
        cardno: this.CARDDATA.cardno,
        cardid: this.CARDDATA.id
      };
    },
    modelkclSub() {
      let params = {
        id: this.CARDDATA.id,
        description: this.formKclFileds.description
      };
      this.http.post("/api/Mebcard/UpdateRemark", params).then(res => {
        if (res.status) {
          this.$Message.success("保存成功");
          this.modelkcl = false;
          this.$store.getters.data().viewPageTest.refresh();
        }
      });
    },
    getFirstRow() {
      this.$refs.myCFZform.validate(() => {
        let type = "";
        clearTimeout(this.timerId);
        switch (this.modeltitle) {
          case "充值":
            type = 1;
            break;
          case "消费":
            type = 2;
            break;
          case "调整":
            type = 3;
            break;
          case "冲账":
            type = 4;
            break;
        }
        let param = {
          mainData: {
            ...this.jakob,
            ...this.formCFZFileds,
            type_func: type
          },
          detailData: []
        };
        this.timerId = setTimeout(() => {
          this.http.post("/api/mebRecharge/Add", param).then(res => {
            if (res.status) {
              this.modelCFZ = false;
              this.$Message.success("操作成功");
              this.getPagData(this.jakob.cardid);
            } else {
              this.$Message.error(res.message);
            }
          });
        }, 1000);
      });
    },
    getPagData(e) {
      let parmas = {
        page: 1,
        rows: 9999,
        sort: "createDate",
        order: "desc",
        wheres: `[{\"name\":\"cardid\",\"value\":\"${e}\",\"displayType\":\"string\"}]`
      };
      this.http.post("/api/mebRecharge/getPageData", parmas).then(res => {
        this.tableDataKcl = res.rows;
      });
    },
    // 冻结
    cancfreeze() {
      let param = {
        mainData: {
          id: this.CARDDATA.id,
          is_freeze: this.formKclFileds.is_freeze == 1 ? 0 : 1
        }
      };
      this.http.post("/api/MebCard/Freeze", param).then(res => {
        this.$Message.success("成功");
        this.$store.getters.data().viewPageTest.refresh();
        this.modelkcl = false;
      });
    },
    // 作废
    cancellation() {
      let param = {
        mainData: {
          id: this.CARDDATA.id,
          cardstatus: 5
        }
      };
      this.http.post("/api/MebCard/Recovery", param).then(res => {
        this.$Message.success("作废成功");
        this.$store.getters.data().viewPageTest.refresh();
        this.modelkcl = false;
      });
    },
    // 延期
    extension() {
      this.model6 = true;
      this.formRules6 = [
        [
          {
            title: "延期时间",
            field: "validendatedate",
            type: "datetime",
            min: this.CARDDATA.validatedate,
            required: true
          }
        ]
      ];
      this.formFields6.validendatedate = "";
    },

    // 密码
    steganogram() {
      let oldPassword = this.getForm7("oldPassword");
      let newPassword = this.getForm7("newPassword");
      let repeatPassword = this.getForm7("repeatPassword");
      if (this.CARDDATA.password) {
        this.model7 = true;
        oldPassword.disabled = false;
        newPassword.hidden = false;
        repeatPassword.hidden = false;
        newPassword.required = true;
        repeatPassword.required = true;
        this.$nextTick(() => {
          this.$refs.myform7.reset();
          this.formFields7.oldPassword = "";
        });
      } else {
        this.$confirm("是否需要密码", "提示", {
          confirmButtonText: "是",
          cancelButtonText: "否",
          type: "warning"
        })
          .then(() => {
            this.model7 = true;
            this.$nextTick(() => {
              this.$refs.myform7.reset();
              this.formFields7.oldPassword = "888888";
              this.formFields7.newPassword = "888888";
              this.formFields7.repeatPassword = "888888";
            });

            newPassword.hidden = true;
            repeatPassword.hidden = true;
            newPassword.required = false;
            repeatPassword.required = false;
            oldPassword.disabled = true;
          })
          .catch(() => {
            let params = { id: this.CARDDATA.id, isHave: 0 };
            this.http.post("/api/MebCard/UpdateisHave", params).then(res => {
              this.$Message.success("修改成功");
              this.$store.getters.data().viewPageTest.refresh();
            });
          });
      }
    },

    submit7() {
      this.$refs.myform7.validate(() => {
        console.log(this.formFields7);
        let params = {
          ...this.formFields7,
          id: this.CARDDATA.id,
          isHave: 1
        };
        let s = false;
        if (this.CARDDATA.password) {
          if (this.formFields7.newPassword != this.formFields7.repeatPassword) {
            s = false;
            this.$Message.error("两次密码输入不一致！");
          } else {
            s = true;
          }
        } else {
          s = true;
        }
        if (s) {
          this.http.post("/api/MebCard/UpdateisHave", params).then(res => {
            if (res.status) {
              this.$Message.success("修改成功");
              this.model7 = true;
            } else {
              this.$Message.error(res.message);
              this.model7 = true;
            }
            // 卡过期 不能进行操作 后端返回300
            this.$store.getters.data().viewPageTest.refresh();
          });
        }
      });
    },
    GetVueDictionary() {
      let cardstatus = this.getFormKclOption("cardstatus");
      this.http
        .post("/api/Dictionary/GetVueDictionary", [
          "MebCardStatus",
          "MebCardType"
        ])
        .then(res => {
          res.forEach(i => {
            console.log(i);
            if (i.dicNo == "MebCardStatus") {
              cardstatus.data = i.data;
              this.MebCardStatus = i.data;
              this.formRuleskp[0][1].data = i.data;
            } else if (i.dicNo == "MebCardType") {
              this.MebCardType = i.data;
              this.formRuleskp[0][0].data = i.data;
            }
          });
        });
    },
    getFormOption(field) {
      let option;
      this.editFormOptions.forEach(x => {
        x.forEach(item => {
          if (item.field == field) {
            option = item;
          }
        });
      });
      return option;
    },
    fakaUsers() {
      let params = {
        order: "desc",
        page: 1,
        rows: 9999999,
        sort: "id",
        wheres: "[]"
      };
      this.http.post("/api/Users/GetSysUser", params).then(res => {
        this.formRules4[0][0].data = [];
        res.rows.forEach(i => {
          let obj = {
            key: i.user_Id,
            label: i.userTrueName
          };
          this.formRules4[0][0].data.push(obj);
        });
      });
    },
    MebCardGet() {
      this.model2 = true;
      // this.tableData = [];
      if (this.vc == 2) {
        this.formFieldskp.cardstatus = 2;
      }
      this.getList();
    },
    getList() {
      let userID = JSON.parse(sessionStorage.getItem("sessionStorageUSER"));
      let param = {
        order: "desc",
        page: this.queryParams.page,
        rows: this.queryParams.size,
        sort: "",
        wheres: `[{\"name\":\"cardstatus\",\"value\":\"${this.formFieldskp.cardstatus}\",\"displayType\":\"text\"},{\"name\":\"operatorID\",\"value\":\"${userID.userId}\",\"displayType\":\"like\"},{\"name\":\"cardtype\",\"value\":\"${this.formFieldskp.cardtype}\",\"displayType\":\"select\"}]`
      };
      this.http.post("/api/MebCard/getPageData", param).then(res => {
        this.tableData2 = res.rows;
        this.checkPageStatus(this.tableData2);
        this.fyTotal = res.total;
      });
    },
    // 查看卡
    cardLook(row) {
      console.log(row);
      this.http
        .post("/api/MebCard/QueryMemCardRecord", { cardId: row.id })
        .then(res => {
          console.log(res);
          this.tableDataLook = res.data;
        });
    },
    // 开卡
    submit1() {
      this.$refs.myform.validate(() => {
        if (this.saveCheckList.length != 0) {
          let param = {
            memberId: this.member_phone,
            memberName: this.formFields.name
          };
          if (this.KKSTATUS) {
            param.cardId = this.saveCheckList.map(i => i.id).join();
          } else {
            param.cardId = this.CARDDATA.id;
          }
          let today = new Date();
          let params = {
            mainData: {
              ...this.formFields,
              ...this.formFields5,
              member_name: this.formFields.name,
              membertype: 0,
              memberlevel: 0,
              prerogative_begintime: formatDate(
                today.getTime() - 24 * 60 * 60 * 1000
              ),
              prerogative_endtime: formatDate(
                new Date(
                  today.getFullYear() + 1,
                  today.getMonth(),
                  today.getDate() + 1
                )
              ),
              disabled_status: 0
            },
            detailData: []
          };
          if (this.HYZHSTATUS) {
            this.http.post("/api/MebAccount/MemberAdd", params).then(res => {
              if (res.status) {
                param.memberId = res.data.data.member_phone;
                this.http.post("/api/MebCard/UpdateMemberId", param).then(res => {
                  if (res.status) {
                    this.model = false;
                    this.$Message.success("开卡成功");
                    this.$store.getters.data().viewPageTest.refresh();
                  } else {
                    this.$Message.error(res.message);
                  }
                });
              }
            });
          } else {
            let paramMebAcc = {
              order: "desc",
              page: 1,
              rows: 30,
              sort: "",
              wheres: `[{\"name\":\"member_phone\",\"value\":\"${this.formFields.member_phone}\",\"displayType\":\"text\"}]`
            };
            this.http
              .post("/api/MebAccount/GetMebAccountPageData", paramMebAcc)
              .then(res => {
                if (res.rows.length != 0) {
                  this.formFields.name = res.rows[0].member_name;
                  this.member_phone = res.rows[0].member_phone;
                  param.memberId = res.rows[0].member_phone;
                  this.http
                    .post("/api/MebCard/UpdateMemberId", param)
                    .then(res => {
                      if (res.status) {
                        this.model = false;
                        this.$Message.success("开卡成功");
                        this.$store.getters.data().viewPageTest.refresh();
                      } else {
                        this.$Message.error(res.message);
                      }
                    });
                }
              });
          }
        } else {
          this.$Message.error("请选择卡");
        }
      });
    },
    // 开卡选择卡片
    submit2() {
      this.model2 = false;
      // this.tableData = this.$refs.editTable2.$refs.table.selection;
    },

    // 发卡
    submit4() {
      if (this.saveCheckList.length != 0) {
        this.loading = true;
        let param = {
          cardId: this.saveCheckList.map(i => i.id).join(),
          operatorId: this.formFields4.opersqrorId.join() + ","
        };
        this.http.post("/api/MebCard/UpdateOperator", param).then(res => {
          if (res.status) {
            this.model4 = false;
            this.loading = false;
            this.$Message.success("发卡成功");
            this.$store.getters.data().viewPageTest.refresh();
          } else {
            this.loading = false;
            this.$Message.error(res.message);
          }
        });
      } else {
        this.$Message.error("请选择卡");
      }
    },
    // 延期
    submit6() {
      let param = {
        mainData: {
          id: this.CARDDATA.id,
          ...this.formFields6
        }
      };
      this.http.post("/api/MebCard/Recovery", param).then(res => {
        this.$Message.success("延期成功");
        this.model6 = false;
        this.$store.getters.data().viewPageTest.refresh();
      });
    },
    // 写卡

    WriteCard() {
      this.rowID = this.CARDDATA.id;
      // console.log(this.CARDDATA);
      this.openReader();
      let cardno1;
      for (let index = 0; index < this.CARDDATA.cardno.length; index++) {
        const element = this.CARDDATA.cardno[index];
        cardno1 += element.charCodeAt();
      }
      // console.log(cardno1);
      setTimeout(() => {
        this.readM1Card();
      }, 500);
      setTimeout(() => {
        this.VerifyKey33();
      }, 1000);
      setTimeout(() => {
        this.ReadCardM33();
      }, 1500);

      setTimeout(() => {
        this.WriteCardM33(this.CARDDATA.hexcardno.substr(0, 16));
      }, 2000);
      if (this.CARDDATA.hexcardno.length > 16) {
        setTimeout(() => {
          this.readM1Card();
        }, 2500);
        setTimeout(() => {
          this.VerifyKey34();
        }, 3000);
        setTimeout(() => {
          this.ReadCardM34();
        }, 3500);

        setTimeout(() => {
          this.WriteCardM34(this.CARDDATA.hexcardno.substr(16, 32));
        }, 4000);
      }
    },
    // 补卡 wangfei
    ReplacementCard() {
      // console.log("补卡");
      this.$confirm("是否确认补卡", "提示", {
        confirmButtonText: "是",
        cancelButtonText: "否",
        type: "warning"
      })
        .then(() => {
          let params = { cardId: this.CARDDATA.id };
          this.http.post("/api/MebCard/CardReplacement", params).then(res => {
            if (res.status) {
              this.$Message.success("补卡成功");
              this.$store.getters.data().viewPageTest.refresh();
            } else {
              this.$Message.success(res.message);
            }
          });
        })
        .catch(() => {});
    },
    async readM1Card() {
      try {
        if (this.socket.readyState == 1) {
          this.socket.send("EST_FindCardM1#");
        } else {
          this.$message.error("未找到控件，请检查控件是否安装.");
        }
      } catch (ex) {
        this.$message.error("连接异常,请检查是否成功安装控件.");
      }
    },
    VerifyKey33() {
      try {
        if (this.socket.readyState == 1) {
          this.socket.send("EST_VerifyKeyM1#|Key_A|8|FFFFFFFFFFFF");
        } else {
          this.$message.error("未找到控件，请检查控件是否安装.");
        }
      } catch (ex) {
        this.$message.error("连接异常,请检查是否成功安装控件.");
      }
    },
    VerifyKey34() {
      try {
        if (this.socket.readyState == 1) {
          this.socket.send("EST_VerifyKeyM1#|Key_A|8|FFFFFFFFFFFF");
        } else {
          this.$message.error("未找到控件，请检查控件是否安装.");
        }
      } catch (ex) {
        this.$message.error("连接异常,请检查是否成功安装控件.");
      }
    },
    WriteCardM33(cardno) {
      try {
        if (this.socket.readyState == 1) {
          this.socket.send("EST_WriteCardM1#|32|595A4C5943432020" + cardno);
        } else {
          this.$message.error("未找到控件，请检查控件是否安装.");
        }
      } catch (ex) {
        this.$message.error("连接异常,请检查是否成功安装控件.");
      }
    },
    WriteCardM34(cardno) {
      try {
        if (this.socket.readyState == 1) {
          this.socket.send("EST_WriteCardM1#|33|" + cardno);
        } else {
          this.$message.error("未找到控件，请检查控件是否安装.");
        }
      } catch (ex) {
        this.$message.error("连接异常,请检查是否成功安装控件.");
      }
    },
    ReadCardM33() {
      try {
        if (this.socket.readyState == 1) {
          this.socket.send("EST_ReadCardM1#|32");
        } else {
          this.$message.error("未找到控件，请检查控件是否安装.");
        }
      } catch (ex) {
        this.$message.error("连接异常,请检查是否成功安装控件.");
      }
    },
    ReadCardM34() {
      try {
        if (this.socket.readyState == 1) {
          this.socket.send("EST_ReadCardM1#|33");
        } else {
          this.$message.error("未找到控件，请检查控件是否安装.");
        }
      } catch (ex) {
        this.$message.error("连接异常,请检查是否成功安装控件.");
      }
    },
    openReader() {
      var host = "ws://127.0.0.1:33666"; //客户端电脑本地IP，非服务器IP，无需修改
      if (this.socket == null) {
        this.socket = new WebSocket(host);
      } else {
        // this.resultMsg("已初始化.");
      }
      try {
        var _this = this;
        this.socket.onopen = () => {
          // console.log(this.socket.readyState);
          // _this.resultMsg("初始化成功."); //可以注释
          // _this.$options.methods.getVersion(); //可以注释：控件版本号
          // _this.$options.methods.readSAMID(); //可以注释：读卡器芯片号，全球唯一，通常可用来授权管理
          //autoReadIDCard(); //自动读卡可以放这里，自动读卡放身份证的间隔要>300ms，否则会不读卡
        };
        this.socket.onclose = res => {
          this.$message.error("读卡服务已经断开");
        };
        this.socket.onerror = res => {
          this.$message.error("请检查控件是否正常安装");
        };
        this.socket.onmessage = msg => {
          if (typeof msg.data == "string") {
            var msgM = msg.data + "";
            var msgJson = JSON.parse(msgM);
            if (msgJson.errMsg == "连接读卡器失败") {
              this.$message.error("连接读卡器失败");
            } else {
              switch (msgJson.fun) {
                case "EST_GetVersion#": // 获取版本号
                  _this.resultMsg("版本号：" + msgJson.errMsg);
                  break;

                case "EST_ReadCertID#": //身份证物理ID
                  if (msgJson.rCode == "0") {
                    console.log("ic", msgJson.UID);
                    let olb = {
                      id: this.rowID,
                      cardno: msgJson.UID
                    };
                    this.http
                      .post("api/MebCard/UpdatePhysicalCard", olb)
                      .then(res => {
                        if (res.status) {
                          this.$Message.success("写卡成功");
                        }
                      });
                  } else {
                    _this.resultMsg(msgJson.errMsg);
                  }
                  break;

                case "EST_ReadM1Card#": //IC卡卡号
                  if (msgJson.rCode == "0") {
                    console.log("ic", msgJson.UID);
                  } else {
                    _this.resultMsg(msgJson.errMsg);
                  }
                  break;
                case "EST_FindCardM1#":
                  if (msgJson.rCode == "0") {
                    _this.resultMsg("寻卡成功，M1卡UID：" + msgJson.Uid);
                    console.log("ic", msgJson.Uid);
                    let olb = {
                      id: this.rowID,
                      cardno: msgJson.Uid
                    };
                    this.http
                      .post("api/MebCard/UpdatePhysicalCard", olb)
                      .then(res => {
                        if (res.status) {
                          this.$Message.success("写卡成功");
                        }
                      });
                  } else {
                    _this.resultMsg(msgJson.errMsg);
                  }
                  break;
                case "EST_VerifyKeyM1#":
                  if (msgJson.rCode == "0") {
                    _this.resultMsg("秘钥认证成功");
                  } else {
                    _this.resultMsg(msgJson.errMsg);
                  }
                  break;

                case "EST_ReadCardM1#":
                  if (msgJson.rCode == "0") {
                    _this.resultMsg("读卡成功，数据为：" + msgJson.readData);
                  } else {
                    _this.resultMsg(msgJson.errMsg);
                  }
                  break;

                case "EST_WriteCardM1#":
                  if (msgJson.rCode == "0") {
                    _this.$Message.success("写卡成功");
                  } else {
                    _this.resultMsg(msgJson.errMsg);
                  }
                  break;

                case "EST_PowerOnCpu#": //非接CPU卡上电信息
                  if (msgJson.rCode == "0") {
                    _this.resultMsg("复位信息：" + msgJson.ATR);
                  } else {
                    _this.resultMsg(msgJson.errMsg);
                  }
                  break;

                case "EST_WriteCpu#": //非接CPU卡APDU指令响应信息
                  if (msgJson.rCode == "0") {
                    _this.resultMsg("响应数据：" + msgJson.Resp);
                  } else {
                    _this.resultMsg(msgJson.errMsg);
                  }
                  break;

                default:
                  break;
              }
            }
          } else {
            alert("连接异常,请检查是否成功安装控件.");
          }
        };
      } catch (ex) {
        alert("连接异常,请检查是否成功安装控件.");
      }
    },
    resultMsg(msg) {
      if (msg != "" && msg != undefined) console.log(msg);
    }
  }
};
export default vueParam;
</script>

<style lang="less" scoped>
.tjBut {
  margin: 10px;
}
.tableScoll {
  overflow: auto;
}
</style>
